package com.mrzhou.common.feign.client;

import com.mrzhou.common.constant.CommonConstant;
import com.mrzhou.common.entity.system.UserInfo;
import com.mrzhou.common.feign.factory.UserClientFallbackFactory;
import com.mrzhou.core.tool.api.R;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;

@FeignClient(
        value = CommonConstant.APPLICATION_CLOUD_USER,
        fallbackFactory = UserClientFallbackFactory.class
)
public interface IUserClient {

    String USER_INFO = CommonConstant.API_PREFIX + "/user-info";
    String USER_INFO_BY_ID = CommonConstant.API_PREFIX + "/user-info-by-id";
    String USER = CommonConstant.API_PREFIX + "/user";

    @GetMapping(USER_INFO)
    R<UserInfo> userInfo(@RequestParam("account") String username);

    @GetMapping(USER_INFO_BY_ID)
    R<UserInfo> userInfoById(@RequestParam("userId") Long userId);


}
